package com.sansecy.android.simplevideo;

import android.net.Uri;

/**
 * 项目名称：VideoTest
 * 类 名 称：Player
 * 类 描 述：TODO
 * 创建时间：2019-11-15 13:07
 * 创 建 人：sansecy
 */
public interface Player {
    void start();

    void pause();

    int getDuration();

    int getCurrentPosition();

    void seekTo(int pos);

    boolean isPlaying();

    int getBufferPercentage();

    void loadUrl(String url);

    void loadUri(Uri uri);

    void openVideo();

    void stopPlayback();

    interface OnPreparedListener {
        void onPrepared();
    }

    interface OnCompletionListener {
        void onCompletion();
    }

    interface OnBufferingUpdateListener {
        void onBufferingUpdate(int percent);
    }

    interface OnSeekCompleteListener {
        void onSeekComplete();
    }

    interface OnVideoSizeChangedListener {
        void onVideoSizeChanged(int width, int height);
    }

    interface OnErrorListener {
        boolean onError(int what, int extra);
    }

    interface OnInfoListener {
        boolean onInfo(int what, int extra);
    }
}
